// 短信发送
export const sendSmsApi = <T>(data: any) =>
  uni.http<T>({
    url: 'doctorapp/v1/send_sms',
    method: 'GET',
    data,
  })

// 注册
export const registerApi = <T>(data: any) =>
  uni.http<T>({
    url: 'blapp/v1/register',
    method: 'POST',
    data,
  })

// 忘记密码提交
export const forgetPasswordApi = <T>(data: any) =>
  uni.http<T>({
    url: 'blapp/v1/forget',
    method: 'POST',
    contentTypeKey: 'form',
    data,
  })

// 本机手机号一键登录
export const loginByPhoneApi = <T>(data: any) =>
  uni.http<T>({
    url: 'blapp/v1/test1',
    method: 'POST',
    data,
  })

// 获取os
export const getOSApi = <T>() =>
  uni.http<T>({
    url: 'api/common/is_buy_topic',
    method: 'GET',
    requestType: 'bl',
  })

// 微信登录
export const loginByWechatApi = <T>(data: any) =>
  uni.http<T>({
    url: 'blapp/v1/wechat',
    data,
    from: '微信登录',
  })

// 一键登录cloud
export const loginByOneKeyApi = <T>(data: any) =>
  uni.http<T>({
    url: 'login',
    data,
    requestType: 'cloud',
  })

// 手机短信登录
export const loginBySmsApi = <T>(data: any) =>
  uni.http<T>({
    url: 'doctorapp/v1/login',
    method: 'POST',
    data,
    requestType: 'app',
  })

// 账号密码登录
export const loginByPasswordApi = <T>(data: any) =>
  uni.http<T>({
    url: 'blapp/v1/login',
    method: 'POST',
    data,
  })

// 获取用户信息
export const getUserInfoApi = <T>(data?: any) =>
  uni.http<T>({
    url: 'doctorapp/v1/info',
    method: 'GET',
    data,
    from: '获取用户信息',
  })

// 获取腾讯IM
export const getIMApi = <T>(data?: any) =>
  uni.http<T>({
    url: 'doctorapp/v1/im_user_sig',
    method: 'GET',
    data,
    requestType: 'app',
    from: '获取腾讯IM',
  })
